This invention concerns an agent system in which an agent generated by an agent server is moved consecutively among communication devices via communication lines.
A typical agent system of the type which has recently been proliferating is shown in FIG. 14. Agent server 50, various communication devices 60 (personal computers, work stations, etc.) and storage device 80, which stores a program to generate agents, are all connected via cable line 90 (or, although not pictured, they may be connected cordlessly). This line is used to transfer agent 70, which we shall discuss shortly, from one device to the next.
In such an agent system, agent server 50 generates, based on a source program, an agent 70 consisting of object code. The agent 70 which has been generated is transmitted to a designated communication device 60, where the system agent 601 for that device 60 executes it.
Agent systems of the sort described above use two methods to transmit an agent 70. In one method, the agent is given its destination and target processing but not the route by which it is to reach the destination. In the other method, the agent is given only its target processing and does not receive either its destination or its transmission route.
We shall now discuss these two methods for transmitting an agent, with reference to the flow charts in FIGS. 15 and 16.
Method 1: Agent is given destination and target processing.
Agent server 50 uses a source program which executes specific processing stored in storage device 80 to generate object code. It also generates an agent by assigning a destination to this object code to indicate where it is to go (Step 510), and it sends this agent 70 to its destination.
Agent 70 travels along line 90 to whichever communication device 60 has a node for the specified destination (Step 520). It is taken in by this device 60, whose system agent 601 executes it.
The system agent 601 of this device 60 renders a judgment as to whether the target processing assigned to agent 70 has been completed (Step 530). If it determines that the processing has not been completed (Step 530: N), it returns the agent to its source, agent server 50.
When agent 70 returns to agent server 50, the server respecifies its destination and target processing (Step 550). We return to 520, and the processing described above resumes.
If system agent 601 determines that the target processing has been completed (Step 530: Y), agent 70 is sent back to agent server 50 (Step 540) and the processing is completed.
Method 2: The agent is given only its target processing.
The agent system 601 for agent server 50 generates an agent with its target processing (Step 610). This agent 70 is transmitted via line 90 (Step 620).
Agent 70 is taken in at its destination, communication device 60, and the system agent 601 for that device begins to execute its target processing.
In device 60, the destination of agent 70, a judgment is rendered as to whether the target processing has been completed (Step 630). If it is determined that the processing has not been completed (Step 630: NO), agent 70 returns to step 620, goes to the communication device which is its next destination, and resumes the processing described above.
If system agent 601 determines that the target processing has been completed (Step 630: Y), it sends agent 70 back to agent server 50 (Step 540), and the processing is completed.
Regardless of whether the agent is given both its destination and its target processing or only its target processing, certain problems are inherent in the type of agent system described above.
In the first method mentioned above, in which agent 70 is given both its destination and its target processing, when the agent is to be routed through the nodes of a number of specified devices 60, each node will have to be specified, as there is a 1 to 1 correspondence of destinations when the target processing is executed.
Thus if the target processing cannot be accomplished, agent server 50 will have to respecify all of the destinations, which will result in dead time.
In the second method mentioned above, in which the agent is given only its target processing, it will move to an arbitrary location (searching according to a rule) and execute that processing. Once it is given its target processing, the agent will never need to have its target reassigned. However, there is no way to choose a route, so if the processing is sequential, and there is, for example, an application gateway in a fire wall, the attempt of the agent to pass through will be regarded as an access violation. The agent will be unable to continue to the nodes of the devices 60 on the other side of the fire wall.
(3) In either methods mentioned above, the one in which the agent is given both a destination and the target processing or the one in which it is given only the target processing, agent 70 sets out without knowing the resource state of its destination, device 60. For example, it does not know which regions of the device""s memory are free. If it turns out that the agent is temporarily unable to use the resources of device 60 because, say, there is no free area in the memory to house it, agent 70 will not be generated in that device. It will not return to server 50 within the specified time, and server 50 will have no alternative but to execute error processing.
(4) Right now, the processing code used in device 60 is going to be native code, which is used by an ordinary MPU, or byte code expressed in JAVA, which is used in virtual machines.
As can be seen in FIG. 17, when an agent is sent between systems in which the system agents 601 in server 50 and device 60 use the same code, the system agent at the destination will be able to execute the agent. If the two systems use different codes, it will be unable to execute the agent.
If the two systems use different processing codes, the system to which the agent is sent must use a device 60 with a virtual processor such as a Java Virtual Machine.
The first objective of the present invention is to provide an agent system in which it will not be necessary to respecify the destination and in which the dead time entails in specifying the destination will be minimized.
The second objective of this invention is to provide an agent system in which even if the agent are not routed along a certain set of nodes, it will be able to select another node if need be.
The third objective of this invention is to provide an agent system which can avoid error processing by checking the resource state of the destination device before the agent goes there.
The fourth objective of this invention is to provide an agent system which can execute the processing when the agent is travelling between two systems using different processing codes.
In order to achieve the objectives mentioned above, this invention is configured for an agent system in which an agent server and a number of communication devices are connected via a communication line which may be a cable or cordless line. An agent with routing data generated by the aforesaid agent server travels among the aforesaid communication devices via the aforesaid communication line according to the aforesaid routing data.
The aforesaid communication devices is characterized by having a restoring and transmitting means to restore and transmit the agent which can modify the routing data for the agent which are received and stored in a memory, and which can restore the agent with a specified set of routing data and transmit the restored agent.
In this invention, the aforesaid communication devices is further characterized by having a memory area reserving means to reserve a memory area for the agent in a destining communication device to which the agent is to be sent according to the routing data.
The aforesaid communication devices is further characterized by having an agent""s code converting means to convert an agent""s code which, when according to the routing data the agent is about to be sent to a destining communication device which executes a different processing code, converts the agent to an intermediate code which the destining communication device can process, and transmits the intermediate code to the destining communication device.
The aforesaid communication devices is further characterized by having a memory area reserving and clearing means to reserve the memory area in the destining communication device before the restored agent is sent, and clear the restored agent in the memory area after the restored agent is sent.
In this invention, the aforesaid routing data consists of the numbers of the nodes through which the agent must pass as it moves between devices and the number of times it will be permitted to pass. The aforesaid restoring and transmitting means to restore and transmit an agent, when it restores an agent, subtracts 1 from the previous number of times the agent is permitted to pass that node, and sets the new number of permitted pass in the aforesaid routing data.
The aforesaid restoring and transmitting means deletes from the agent the routing data representing a given node number when the value obtained by subtracting 1 from the number of pass permitted to that node is 0.
When the aforesaid restoring and transmitting means restores an agent, as needed, it may add to the aforesaid routing data new nodes which the agent may pass.
Further it may, as needed, change the number of permitted pass in the routing data for a given node.
The numbers of the nodes of the devices which the aforesaid agent passes through are appended to the agent as cumulative route data. When it transmits an agent to another communication device, the aforesaid restoring and transmitting means may restore the agent with the current node number recorded as cumulative route data.
The aforesaid a memory area reserving means to reserve an area of the memory entails a current state detecting means to detect how far the processing of the received agent has progressed. When this detection means determines that the aforesaid agent has executed a specified location, it reserves an area of memory in the communication device to which the agent is being sent.
The agent server simultaneously transmits a number of agents having different routing data to a final communication device having a final destination node and reads out the cumulative route record from the agents which have returned, and the final communication device sends back to the agent server only the agent which was the first to arrive to the final communication device.
With this invention, the communication devices restore the agents which they receive with changed routing data as needed. This eliminates the need to respecify destinations.
Because the communication devices reserve an area of memory for its storage in whatever device the restored agent is about to be sent to, restored agents can be transmitted reliably to their destinations.
Because the communication devices convert the agent to an intermediate code before transmitting it, agents can be transmitted between devices using different processing systems.
With this invention, an agent acquires cumulative route data when it is restored. Thus when it is to be transmitted to another device, cumulative route data from the agent server through its destination device can be obtained.
Thus by simultaneously sending out a number of agents, the server can discover the quickest route to the destination from the cumulative route data of the first agent to arrive.